<%@ page language="java" contentType="application/octet-stream;charset=utf-8" %>
<%@ include file="/store/include/init_store.jsp" %>
<%@ page import="com.zll.framework.db.*" %>
<%

	if (!isSeller) {
		response.sendRedirect("/");
		return ;
	}


	out.clear();
	out = pageContext.pushBody(); 
	
	
	String excelTitle = "쿠폰발행목록";
	
	response.setHeader("Content-Disposition","attachment;filename="+java.net.URLEncoder.encode(excelTitle, "utf-8")+"_"+StringUtil.today()+".xls");
	response.setHeader("Content-Description","JSP Generated Data");

	String issue_id	= StringUtil.nvl(request.getParameter("issue_id"));


	HashMap infos = new HashMap();
	infos.put("issue_id", issue_id);
	
	PublisherDAO dao = new PublisherDAO();
	HashList info 	= dao.selectCouponInfo(infos);
	HashList list 	= dao.selectCouponNoList(infos);

	list.setSearch("큐북명", info.get("book_name",0));
	
	list.setHeader("coupon_no", 	"쿠폰번호",	MetaData.ALIGN_CENTER);
	list.setHeader("use_date", 		"사용일자",	MetaData.ALIGN_CENTER);
	list.setHeader("init_date", 	"발행일자",	MetaData.ALIGN_CENTER);
	
	list.writeToExcel(response, excelTitle);
%>
